
// Author: Rafal Pielech 
// E-mail: rafalpielech@hotmail.com
// Date:   2003.08.25

#ifndef WINCONTEXTS_H
#define WINCONTEXTS_H

#include <windows.h>

// --------------------------------------------------

class WinContexts
{
        private:
                  HWND                  winHand;
                  HDC                   devCtx;
                  HGLRC                 renCtx;
                  PIXELFORMATDESCRIPTOR pixFmtDescr;
                  short                 state;

             void initPFD  ( void );
             void reset    ( void );

        public:
                  WinContexts( void );
                  WinContexts( HWND windowHandle );
                 ~WinContexts( void );

             void initRendCtx ( HWND windowHandle );
            short good        ( void );

             void SwpBuffers ( void );
             void MakeCurrent ( const short flag );
             void deleteCtx   ( void );
};

// --- other often used procedures ---

short SetAndRegisterWndClass( WNDCLASSEX * WClass , const char * WClassName , WNDPROC WProcedure );

#endif
